<?php
class POI {
	function __construct() {}	
}

/**
 * POIList represents an POIList 
 */
class POIList extends Model{
	/**
	 * constructs parent
	 */	
	function __construct() {
		parent::__contruct();
	}
	
	/** 
	 * Gets all POI's.
	 * @return POIList objectarray
	 */	
	function getList(){
		$sth = $this->db->prepare('SELECT p.*, a.*, t.name as type_name, l.lat, l.lng FROM poi p
								   LEFT JOIN attraction a ON a.poi_id = p.id
								   INNER JOIN location l ON l.id = p.location_id
								   INNER JOIN poi_type t ON p.type_id = t.id');
		$sth->execute();
		return $sth->fetchAll(PDO::FETCH_ASSOC);
	}
}